package com.zimin.cloud.system.api;

import com.zimin.cloud.mine.pojo.system.business.PostBO;
import com.zimin.shared.pojo.Result;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.cloud.openfeign.SpringQueryMap;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * @author zimin
 * @since 2022/1/4 5:37 下午
 */
@FeignClient(name = IBaseSystemFeign.SERVER_NAME)
public interface IPostFeign {


    String ROUTER = "/sys/post";

    /**
     * <p>查询岗位列表</p>
     *
     * @param postBO 查询参数
     * @return com.zimin.shared.pojo.Result
     * @since 2022-02-13 10:38:12
     */
    @GetMapping(ROUTER + "/pageList")
    Result postPageList(@SpringQueryMap PostBO postBO);

    /**
     * <p>保存岗位</p>
     *
     * @param postBO
     * @return com.zimin.shared.pojo.Result
     * @since 2022-02-14 15:55:52
     */
    @PostMapping(ROUTER)
    Result save(@RequestBody @Validated PostBO postBO);

    /**
     * <p>修改岗位</p>
     *
     * @param postBO 岗位对象
     * @return com.zimin.shared.pojo.Result
     * @since 2022-02-14 15:59:22
     */
    @PutMapping(ROUTER)
    Result update(@RequestBody @Validated PostBO postBO);

    /**
     * 批量删除岗位
     */
    @DeleteMapping(ROUTER)
    Result delete(@RequestParam(value = "idList") List<String> idList);

    /**
     * 获取所有的岗位
     */
    @GetMapping(ROUTER + "/allPost")
    Result allPost();
}
